#Problem 1

#If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.
#Find the sum of all the multiples of 3 or 5 below 1000.

#R: 233168


def main():
    listNumbers = []
    for number in xrange(1000):
        if number % 3 == 0 or number % 5 == 0:
            listNumbers.append(number)
    return listNumbers
#print sum(main())

def main2():
    for number in xrange(1000):
        if not number % 3 or not number % 5:
            yield number
# print sum(main2())

def main3():
    return [number for number in xrange(1000) if not number % 3 or not number % 5]

# print sum(main3())
if __name__ == '__main__':
    print sum(main())
    print sum(main2())
    print sum(main3())